<?php ob_start();
    $jobcat = Model_Listing_Attribute::one(array('_id' => $this->listing->jobcategory));
    $jobfun = Model_Listing_Attribute::one(array('_id' => $this->listing->jobfunction));

    $education = Model_Listing_Job::getEducation();
	$internal_lng = $this->listing->getInternalLanguage();

?>
    <?php if (!empty($this->listing->jobcategory)) {echo $this->dtDd($this->t('Job Category', $internal_lng), $jobcat->name);}?>
    <?php if (!empty($this->listing->jobfunction)) {echo $this->dtDd($this->t('Job Function', $internal_lng), $jobfun->name);}?>

    <?php if (!empty($this->listing->employmenttype)) {
        $i          = 0;
        $field      = '';
        $views = Model_Listing_Job::getEmploymentType();
        $to_add     = '';
        foreach ((array)$this->listing->employmenttype as $data) {
            $field .= $to_add . $this->t($views[$data], $internal_lng);
            $i++;
            $to_add = ', ';
        }
        echo $this->dtDd($this->t('Employment Type', $internal_lng), $field);
    }?>
    <?php if (!empty($this->listing->joblocation)) {
        $i          = 0;
        $field      = '';
        $views = Model_Listing_Job::getJobLocation();
        $to_add     = '';
        foreach ((array)$this->listing->joblocation as $data) {
            $field .= $to_add . $this->t($views[$data], $internal_lng);
            $i++;
            $to_add = ', ';
        }
        echo $this->dtDd($this->t('Job Location', $internal_lng), $field);
    }?>

    <?php if (!empty($this->listing->careerlevel)) {
        $i          = 0;
        $field      = '';
        $views = Model_Listing_Job::getCareerLevel();
        $to_add     = '';
        foreach ((array)$this->listing->careerlevel as $data) {
            $field .= $to_add . $this->t($views[$data], $internal_lng);
            $i++;
            $to_add = ', ';
        }
        echo $this->dtDd($this->t('Career Level', $internal_lng), $field);
    }?>

    <?php if (!empty($this->listing->salary)) {echo $this->dtDd($this->t('Salary per Month', $internal_lng), 'HKD '.number_format($this->listing->salary));}?>
    <?php if (!empty($this->listing->salary_hour)) {echo $this->dtDd($this->t('Salary per Hour', $internal_lng), 'HKD '.number_format($this->listing->salary_hour));}?>
    <?php if (!empty($this->listing->negotiable)) {
          if ($this->listing->negotiable == 1) {
            echo $this->dtDd($this->t('Negotiable', $internal_lng), 'Yes') ;
          } else {
            echo $this->dtDd($this->t('Negotiable', $internal_lng), 'No') ;
          }
      }
    ?>
    <?php
    if (!empty($this->listing->yearexperience)) {
        $views = Model_Listing_Job::getYearExperience();
        echo $this->dtDd($this->t('Years of Experience', $internal_lng), $this->t($views[$this->listing->yearexperience], $internal_lng));
    }
    ?>

    <?php if (!empty($this->listing->education)) {echo $this->dtDd($this->t('Education Level', $internal_lng), $education[$this->listing->education]);}?>
    <?php if (!empty($this->listing->residentstatus)) {
        $i          = 0;
        $field      = '';
        $views = Model_Listing_Job::getResidentStatus();
        $to_add     = '';
        foreach ((array)$this->listing->residentstatus as $data) {
            $field .= $to_add . $this->t($views[$data], $internal_lng);
            $i++;
            $to_add = ', ';
        }
        echo $this->dtDd($this->t('Resident Status', $internal_lng), $field);
    }?>

    <?php if (!empty($this->listing->freshgraduate)) {
          if ($this->listing->freshgraduate == 1) {
            echo $this->dtDd($this->t('Fresh Graduates Considered', $internal_lng), "Yes") ;}
          else {
            echo $this->dtDd($this->t('Fresh Graduates Considered', $internal_lng), "No") ;}}?>
    <?php
    if (!empty($this->listing->companybenefits)) {
        $i          = 0;
        $field      = '';
        $views = Model_Listing_Job::getCompanyBenefits();
        $to_add     = '';
        foreach ((array)$this->listing->companybenefits as $data) {
            $field .= $to_add . $views[$data];
            $i++;
            $to_add = ', ';
        }
        echo $this->dtDd($this->t('Company Benefits', $internal_lng), $field);
    }
    ?>    

<?php $content = trim(ob_get_clean())?>
<?php if (!empty($content)):?>
	<div class="detail category">
        <h2><?php echo $this->t('Job Information', $internal_lng)?></h2>
        <dl>
            <?php echo $content ?>
        </dl>
    </div>
<?php endif;?>